package com.fymxy.question_bank_management.service.serviceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fymxy.question_bank_management.mapper.StudentMapper;
import com.fymxy.question_bank_management.pojo.Student;
import com.fymxy.question_bank_management.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements StudentService {
    //student业务层实现类
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public int insert(Student student) {
        return studentMapper.insert(student);
    }

    @Override
    public IPage<Student> selectStudentByCourse(Page page, Integer courseNo) {
        return studentMapper.selectStudentByCourse(page,courseNo);
    }

    @Override
    public Student studentLogin(String username, String password){
        return studentMapper.studentLogin(username, password);
    }

    @Override
    public int update(int No, String name) {
        return this.studentMapper.update(No,name);
    }
}
